package com.ws.shop.common;

import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.servlet.DispatcherServlet;

import com.ws.shop.util.SpringUtil;

@SuppressWarnings("serial")
public class SpringDispatcherServlet extends DispatcherServlet {
	
	protected WebApplicationContext initWebApplicationContext() {
		WebApplicationContext applicationContext = super.initWebApplicationContext();
		if("wsAdmin-servlet".equals(this.getNamespace())){
			SpringUtil.setAdminApplicationContext(applicationContext);
		}else if("wsFront-servlet".equals(this.getNamespace())){
			SpringUtil.setFrontApplicationContext(applicationContext);
		}
		return applicationContext;
	}
	
}
